import request from '@/utils/request'

//   获取组织架构

export const getDepartment = () => {
  return request({
    url: '/company/department'
  })
}

// 获取 部门负责人

export const getManagerList = () => {
  return request({
    url: '/sys/user/simple'
  })
}

//  新增 部门

export const addDepartment = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
//  获取部门详情

export const getDepartmentDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

//    更新 部门
export function updateDepartment(data) {
  return request({
    method: 'put',
    url: `/compay/department/${data.id}`
  })
}

/**
 * 删除部门
 */

export const delDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
